from RPi.GPIO import Pin,PWM
import time
class duoji:
    def __init__(self):
        self.pwm=PWM(Pin(5,Pin.OUT))
        self.pwm.freq(50)        
    def yaobai(self):
        c=0
        ts = int((c/180*2+0.5)/20*1023)
        self.pwm.duty(ts)
        time.sleep(2)
        c=90
        ts = int((c/180*2+0.5)/20*1023)
        self.pwm.duty(ts)
        time.sleep(2)    